/*
 * Created by JFormDesigner on Mon May 23 15:34:28 CST 2022
 */

package jw3.c10.view;

import jw3.c10.controllner.*;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

/**
 * @author Brainrain
 */
public class Loginforgeet extends JFrame {
    public Loginforgeet() {
        initComponents();
        setTitle("忘记密码查询");
        setVisible(true);
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setSize(450,450);
        ImageIcon imgIcon=new ImageIcon("images\\q.jpg");
        JLabel im=new JLabel();
        im.setIcon(imgIcon);
        im.setBounds(-10,0,500,400);
        imgIcon.setImage(imgIcon.getImage().
                getScaledInstance(600,500,1));
        this.add(im);



    }

    private void button1MouseClicked(MouseEvent e) {
        // TODO add your code here
        String Account=textField2.getText();
        String UserName=textField3.getText();
        if (UserinfoController.forget(Account,UserName)) {

        }else {
            JOptionPane.showMessageDialog(null,"没有该用户！请重新选择");
        }
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        label2 = new JLabel();
        label3 = new JLabel();
        textField2 = new JTextField();
        label4 = new JLabel();
        textField3 = new JTextField();
        button1 = new JButton();

        //======== this ========
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //---- label2 ----
        label2.setText("\u8d26\u53f7\uff1a");
        label2.setForeground(Color.white);
        contentPane.add(label2);
        label2.setBounds(35, 50, 55, 40);
        contentPane.add(label3);
        label3.setBounds(130, 50, 90, label3.getPreferredSize().height);
        contentPane.add(textField2);
        textField2.setBounds(115, 50, 115, textField2.getPreferredSize().height);

        //---- label4 ----
        label4.setText("\u540d\u5b57\uff1a");
        label4.setForeground(Color.white);
        contentPane.add(label4);
        label4.setBounds(new Rectangle(new Point(35, 130), label4.getPreferredSize()));
        contentPane.add(textField3);
        textField3.setBounds(115, 120, 115, 30);

        //---- button1 ----
        button1.setText("\u67e5\u8be2");
        button1.setForeground(Color.black);
        button1.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                button1MouseClicked(e);
            }
        });
        contentPane.add(button1);
        button1.setBounds(new Rectangle(new Point(70, 185), button1.getPreferredSize()));

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for(int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        pack();
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents

    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JLabel label2;
    private JLabel label3;
    private JTextField textField2;
    private JLabel label4;
    private JTextField textField3;
    private JButton button1;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
